import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login',
    component: () => import('@/views/Main'),
    children: [
      {
        path: '/demo',
        name: 'demo',
        meta: {
          requireAuth: true
        },
        component: () => import('@/views/Demo/dialog')
      },
      {
        path: '/LeaveApplication',
        name: 'LeaveApplication',
        meta: {
          requireAuth: true
        },
        component: () => import('@/views/LeaveApplication/index')
      },
      {
        path: '/ContractApplication',
        name: 'ContractApplication',
        meta: {
          requireAuth: true
        },
        component: () => import('@/views/ContractApplication/index')
      },
      {
        path: '/ConfidentialityAgreement',
        name: 'ConfidentialityAgreement',
        meta: {
          requireAuth: true
        },
        component: () => import('@/views/ConfidentialityAgreement/index')
      },
      {
        path: '/KeyApplication',
        name: 'KeyApplication',
        meta: {
          requireAuth: true
        },
        component: () => import('@/views/KeyApplication/index')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/index')
  }
]

const router = new VueRouter({
  routes
})

export default router
